<template>
	<view>
		<!-- 首页 -->
		<home v-if="PageCur=='my'"></home>
		<!-- 商城 -->
		<shop v-if="PageCur=='shop'"></shop>
		<!-- 活动 -->
		<activity v-if="PageCur=='activity'"></activity>
		<!-- 收益 -->
		<earnings v-if="PageCur=='earnings'"></earnings>
		
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="my">
				<view class='cuIcon-cu-image'>
					<image :src="imgurl+'b' + [PageCur=='my'?'_nav1_s':'_nav1'] + '.png'"></image>
				</view>
				<view :class="PageCur=='my'?'text-main':''">首页</view>
			</view>
			<view class="action" @click="NavChange" data-cur="shop">
				<view class='cuIcon-cu-image'>
					<image :src="imgurl+'b' + [PageCur == 'shop'?'_nav2_s':'_nav2'] + '.png'"></image>
				</view>
				<view :class="PageCur=='shop'?'text-main':''">商城</view>
			</view>
			<view class="action" @click="NavChange" data-cur="activity">
				<view class='cuIcon-cu-image'>
					<image :src="imgurl+'b' + [PageCur == 'activity'?'_nav3_s':'_nav3'] + '.png'"></image>
				</view>
				<view :class="PageCur=='activity'?'text-main':''">活动</view>
			</view>
			<view class="action" @click="NavChange" data-cur="earnings">
				<view class='cuIcon-cu-image'>
					<image :src="imgurl+'b' + [PageCur == 'earnings'?'_nav4_s':'_nav4'] + '.png'"></image>
				</view>
				<view :class="PageCur=='earnings'?'text-main':''">收益</view>
			</view>
		
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'my'
			}
		},
		computed:{
			imgurl(){
				return this.$imgurl
			}
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>

<style>
	
</style>
